home *** CD-ROM | disk | FTP | other *** search
- /* inport.c --- p 517 */
- #include <stdio.h>
- #include <conio.h>
- #define PORT_8259_20 0x20
- #define PORT_8259_21 0x21
- main()
- {
- unsigned int word_8259;
- int p20, p21;
- /* Read both ports of the 8259A */
- word_8259 = inport(PORT_8259_20);
- /* Now read them individually */
- p20 = inportb(PORT_8259_20);
- p21 = inportb(PORT_8259_21);
- printf("Current contents of register at port 20h: %x\n", p20);
- printf("Current contents of register at port 21h: %x\n", p21);
- printf("Result of reading with inpw at port 20h: %x\n", word_8259);
- }